<template>
    <view :class="['input-number', 'bg-white', size]">
        <view @tap="__e" class="sub-btn content-center" :data-event-opts="[['tap', [['handleSub', ['$event']]]]]">
            <text>-</text>
        </view>
        <input @change="__e" :data-event-opts="[['change', [['change', ['$event']]]]]" type="number" :value="num" />
        <view @tap="__e" class="add-btn content-center" :data-event-opts="[['tap', [['handleAdd', ['$event']]]]]">
            <text>+</text>
        </view>
    </view>
</template>

<script>
import tabBar from '@/components/TabBar/tabBar';
(global.webpackJsonp = global.webpackJsonp || []).push([
    ['components/InputNumber/index'],
    {
        '04b8': function (n, t, e) {},
        '210e': function (n, t, e) {
            'use strict';

            var u = e('04b8');
            e.n(u).a;
        },
        4006: function (n, t, e) {
            'use strict';

            e.r(t);
            var u = e('be00');
            var i = e('f010');
            for (var a in i) {
                if (['default'].indexOf(a) < 0) {
                    (function (n) {
                        e.d(t, n, function () {
                            return i[n];
                        });
                    })(a);
                }
            }
            e('210e');
            var c = e('f0c5');
            var o = Object(c.a)(i.default, u.b, u.c, false, null, null, null, false, u.a, void 0);
            t.default = o.exports;
        },
        '44cc': function (n, t, e) {
            'use strict';

            Object.defineProperty(t, '__esModule', {
                value: true
            });
            t.default = void 0;
            var u = {
                props: {
                    value: {
                        type: Number,
                        default: 1
                    },
                    size: {
                        type: String
                    },
                    max: {
                        type: Number
                    },
                    min: {
                        type: Number,
                        default: 1
                    }
                },
                data: function () {
                    return {
                        num: this.value
                    };
                },
                methods: {
                    change: function (n) {
                        if (n.detail.value !== this.value) {
                            this.$emit('change', n.detail.value);
                        }
                    },
                    handleAdd: function () {
                        (this.max && this.num >= this.max) || (this.num++, this.$emit('change', this.num));
                    },
                    handleSub: function () {
                        if (this.num > this.min) {
                            this.num--;
                            this.$emit('change', this.num);
                        }
                    }
                }
            };
            t.default = u;
        },
        be00: function (n, t, e) {
            'use strict';

            e.d(t, 'b', function () {
                return u;
            });
            e.d(t, 'c', function () {
                return i;
            });
            e.d(t, 'a', function () {});
            var u = function () {
                this.$createElement;
                this._self._c;
            };
            var i = [];
        },
        f010: function (n, t, e) {
            'use strict';

            e.r(t);
            var u = e('44cc');
            var i = e.n(u);
            for (var a in u) {
                if (['default'].indexOf(a) < 0) {
                    (function (n) {
                        e.d(t, n, function () {
                            return u[n];
                        });
                    })(a);
                }
            }
            t.default = i.a;
        }
    }
]);
(global.webpackJsonp = global.webpackJsonp || []).push([
    'components/InputNumber/index-create-component',
    {
        'components/InputNumber/index-create-component': function (n, t, e) {
            e('543d').createComponent(e('4006'));
        }
    },
    [['components/InputNumber/index-create-component']]
]);
</script>
<style>
@import './index.css';
</style>
